package com.qf.day07.tuxing;

public class Rectangle extends Tuxing{
    private double width;
    private double height;

    public Rectangle() {
    }

    public Rectangle(String name, double width, double height) {
        super(name);
        this.width = width;
        this.height = height;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    @Override
    public double zc() {
        super.zc();
        double zc = (width + height) * 2;
        System.out.println(getName()+"的周长为："+zc);
        return zc;
    }

    @Override
    public void area() {
        super.area();
        double area = width * height;
        System.out.println(getName()+"的面积为："+area);
    }
}
